package com.hyq.learn.api.validator;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @author : heyuqin
 * @since : 2024/04/10 11:47
 */
public class EnumValidator implements ConstraintValidator<EnumValid, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        
        return false;
    }
//    @Override
//    public boolean isValid(BaseEnum baseEnum, ConstraintValidatorContext constraintValidatorContext) {
//        if (Objects.isNull(baseEnum)){
//            return true;
//        }
//        return Arrays.asList(((ConstraintValidatorContextImpl) constraintValidatorContext).getConstraintDescriptor().getAttributes().get("value")).contains(baseEnum);
//    }
}
